package com.xiaode.common.constant;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public interface Const {

	public static final String salt = "bfly";
	
	public static final String binDingCode = "binDingCode:";
	public static final Long binDingCodeLiveSeconds = 300L;
	
    /**
     *  redis名称
     */
    static final String appRedis = "redis";//redis名称
    
    /**
     * 榜样任务任务数量限制
     */
    public static final int exampleTaskMaxNum = 3;
    
    /**
     * 每月之星中发帖回复计的分每月上限
     */
    public static final int monthMaxMark = 10;
    
    /**
     * 用户数据redis存储
     */
    public static final class user {
        public static final String loginStudent = "loginStudent:";//登录的学生
        public static final String loginAdmin = "loginAdmin:";//登录的管理员
        public static final String loginExternal = "loginExternal:";//登录的外部账号
//        public static final String loginParent = "loginParent:";//登录的管理员
        public static final long timeToLiveSeconds = 1209600L;//用户信息储存时长
//        public static final int timeToLiveDay = 14;//用户信息储存时长
        public static final String ParentBinDingCode = "ParentBinDingCode:";//父母绑定二维码

        //初始化redis数据前缀
        public static final String Student = "stu:Info:";  //学生信息 + id
        public static final String StudentScore = "stu:score"; //学生分数   作为排名使用
        public static final String Admin = "admin:"; // 教师信息
        public static final String Parent = "parent:"; // 家长信息
        public static final String External = "external:"; // 外部账号信息
        public static final String AccountIdInfo = "user:accountId"; // 账号信息

        
        //用户最后使用时间
        public static final String lastLoginTimeS = "lastLoginTime:student:";
        public static final String lastLoginTimeT = "lastLoginTime:teacher:";
        public static final String lastLoginTimeE = "lastLoginTime:external:";
//        public static final String lastLoginTimeP = "lastLoginTime:parent:";

        //存储用户版本
//        public static final String studentVersion = "student:version";
//        public static final String adminVersion = "teacher:version";
        
    }
    
    /**
     * 用户类型
     */
    public static final class UserType {
        public static final int student = 2;//学生
        public static final int admin = 1;//老师
        public static final int parent = 3;//家长
        public static final int external = 4;//外部
    }
    
    /**
     * 密保
     */
    public static final class SecretProtection {
        public static final String problem = "problem:";//密保问题
        public static final String AnswerCode = "AnswerCode:";//密保问题
    }

    /**
     * 通用周期参数
     */
    public static final class cycle {
        public static final int EVERYDAY = 1;//每日
        public static final int EVERYWEEK = 2;//每周
        public static final int EVERYMONTH = 3;//每月
    }

    /**
     * 模块使用统计
     */
    public static final class modularType{
        public static final Map<Integer,String> hashMap = new HashMap<>();
        static {
            hashMap.put(1,"虚拟形象");
            hashMap.put(2,"任务");
            hashMap.put(3,"学生消息");
            hashMap.put(4,"个人中心");
            hashMap.put(5,"社群交流");
        }
        public static final short STUDENT_EXAMPLE_MODULAR = 1;//虚拟形象模块
        public static final short STUDENT_TASK_MODULAR = 2;//任务模块
        public static final short STUDENT_MESSAGE_MODULAR = 3;//学生消息模块
        public static final short STUDENT_USER_MODULAR = 4;//个人中心
        public static final short STUDENT_COMMUNITY_MODULAR = 5;//社群交流模块

        public static final short ADMIN_EXAMPLE_MODULAR = 1;//学生榜样模块
        public static final short ADMIN_TASK_MODULAR = 2;//学生任务模块
        public static final short ADMIN_MESSAGE_MODULAR = 3;//学生消息模块
        public static final short ADMIN_USER_MODULAR = 4;//学生用户模块
    }

    /**
     * 允许上传的文件类型
     */
    public static final class fileType{  //允许上传的文件类型
        public static final Set<String> picSet = new HashSet<>();
        public static final Set<String> voiceSet = new HashSet<>();
        public static final Set<String> fileSet = new HashSet<>();
        static {
            //图片Bmp, jpg(jpeg), png, gif, webp
            picSet.add("bmp");
            picSet.add("jpg");
            picSet.add("jpeg");
            picSet.add("png");
            picSet.add("gif");
            picSet.add("webp");
            //音频mp3、aac/mp4、ape/flac、wav、wma、amr、mid
            voiceSet.add("mp3");
            voiceSet.add("mp4");
            voiceSet.add("aac");
            voiceSet.add("ape");
            voiceSet.add("flac");
            voiceSet.add("wav");
            voiceSet.add("wma");
            voiceSet.add("amr");
            voiceSet.add("mid");
            voiceSet.add("MOV");
            //文件txt、doc、wps、docx、xls、xlsx、pdf
            fileSet.add("txt");
            fileSet.add("text");
            fileSet.add("doc");
            fileSet.add("wps");
            fileSet.add("docx");
            fileSet.add("xls");
            fileSet.add("xlsx");
            fileSet.add("pdf");
            fileSet.add("zip");
            fileSet.add("rar");
            fileSet.add("7-Zip");
            fileSet.add("gzip");
            fileSet.add("bzip2");
            fileSet.add("7z");
            fileSet.add("pptx");
            fileSet.add("md");
        }
        public static boolean contains(String name){
            return picSet.contains(name) || fileSet.contains(name) || voiceSet.contains(name);
        }
        public static String getType(String name){
            return picSet.contains(name) ? "picture" : voiceSet.contains(name) ? "voice" : "file";
        }

    }

    
    /**
     * 聊天服务器中需要用的
     * 初始化时存入
     * 1.全校群聊 2.榜样群 3.家校沟通 4.校级群聊 5.年级群聊 6.班级群聊 7.普通群 8.部门群
     */
    public static final class chatService {
        public static final Integer ALL_SCHOOL_GROUP = 1;
        public static final Integer EXAMPLE_GROUP = 2;
        public static final Integer PARENT_SCHOOL_GROUP = 3;
        public static final Integer SCHOOL_GROUP = 4;
        public static final Integer GRADE_GROUP = 5;
        public static final Integer CLASS_GROUP = 6;
        public static final Integer COMMON_GROUP = 7;
    }
    
    /**
     * 聊天群成员类型
     * 管理级别(0群主,1普通成员,2管理)
     */
    public static final class chatGroupUserLevel {
        public static final Integer LEADER = 0;//群主
        public static final Integer COMMON = 1;//普通成员
        public static final Integer MANAGE = 2;//管理
    }

    public static final class serverConst{
        public static final String serviceSalt = "xiaode";
        public static final String serviceSecretKey = "xiao:secretKey";
        /**
         * 储存其他服务器调用,失效时间
         * serviceCall:serviceId=次数
         */
        public static final String serviceCall = "serviceCall:"; //储存其他服务器调用,失效时间

    }

    public static final class filePath{
        public static final String FILE_UPLOAD = "file:";
        public static final Long FILE_TIME = 300L;
    }

    /**
     * 任务类型
     */
    public static final class taskType{
        public static final int ORDINARY_USER_TASK_TYPE = 1; //普任务
        public static final int LABORU_TASK_TYPE = 2;  // 日常劳动
        public static final int VOCATION_TASK_TYPE = 3;  //职业体验
        public static final int EXAMPLE_ACTIVITY_TASK_TYPE = 4;  //重要他人
        public static final int EXERCISE = 5;  //锻炼，不算任务没有记录
        public static final int ACTIVITY = 6;  //活动
    }
    
    /**
     * 任务审核/完成状态
     */
    public static final class taskState{
        public static final int UNAUDITED = 1; //待审核
        public static final int REVIEWED = 2;  //已审核
    }
    
    /**
     * 我的校园分享类型
     * 2.教师推荐 3.原创发布
     */
    public static final class campusShareType{
    	public static final int RECOMMEND = 2; //教师推荐
        public static final int ORIGINAL = 3;  //原创发布
    }
    
    /**
     * 评论的层级类型
     * 1.评论内容 2.评论回复
     */
    public static final class campusShareCommentStratum{
    	public static final int SHARE = 1; //评论内容
        public static final int REPLY = 2; //评论回复
    }
    
    /**
     * 加分事件类型
     * 事件类型 2.当天锻炼打卡 4.普通任务得分 5.活动得分 6.日常劳动 7.职业体验 8.重要他人
     */
    public static final class addMarkEventType{
        public static final int TODAY_EXERCISE = 2; //当天锻炼打卡
        public static final int ORDINARY_TASK = 4; //普通任务得分
        public static final int ACTIVITY = 5; //活动评分得分(任务)
        public static final int LABORU_TASK = 6;  // 日常劳动
        public static final int VOCATION_TASK = 7;  //职业体验
        public static final int EXAMPLE_TASK = 8;  //重要他人
        public static final int ACTIVITY_PARTAKE = 9; //活动参与得分
    }
    
    /**
     * welink常量
     */
    public static final class welink{
    	public static final String WELINK_ACCESS_TOKEN_TIME = "WELINK_ACCESS_TOKEN_TIME";
    }

    /**
     * 人脸审核状态1.待审核，2.审核通过，3.未通过
     */
    public static final class faceState{
    	public static final int UNAUDITED = 1; //待审核
        public static final int PASS = 2;  //通过
        public static final int NOPASS = 3;  //未通过
    }
    
    /**
     * 通知类型
     */
    public static final class notifyType{
    	public static final int FACE_EXAMINE = 1; //人脸审核
    }
    
    /**
     * 摄像头的使用功能类型：1.教室内直播，2.进教室，3.出教室
     */
    public static final class cameraUseType{
    	public static final int video = 1; //教室内直播
    	public static final int ENTER = 2; //进教室
    	public static final int EXIT = 3; //出教室
    }
    
    /**
     * 行为类型：1.进入，2.出去
     */
    public static final class behaviorType{
    	public static final int ENTER = 1; //进教室
    	public static final int EXIT = 2; //出教室
    }
    
    /**
     * 人脸通知的未读和已读
     */
    public static final class faceNotifyReadType{
    	public static final int NOREAD = 1; //未读
    	public static final int READ = 2; //已读
    }
    
    
}
